package com.cbn.ibcp.web.common.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Configuration
public class GsCmsConfig {
    @Value("${gs-cms.cdnOrgCodesStr}")
    private String cdnOrgCodesStr;


    public static List<String> cdnOrgCodeList = new ArrayList<>();


    @PostConstruct
    public void init() {
        cdnOrgCodeList = getCdnOrgCodeList();
    }

    public List<String> getCdnOrgCodeList() {
        return Arrays.asList(cdnOrgCodesStr.split(","));
    }
}
